package com.wenhai.xiaomage.spring.ioc.overview.dependency.xml.replacedmethod;

import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.config.BeanDefinition;

/**
 * @Author:wenhai
 * @Description: {@link BeanDefinition} replaced-method
 * @Date:2020/4/6
 */
public class ChangeMethod implements BeanNameAware {
    private String beanName;

    public void changeMe() {
        System.out.println("changeMe");
    }
//
//    @Override
//    public void destroy() throws Exception {
//        System.out.println("调用destroy方法 "+beanName + " 正在销毁");
//    }

    @Override
    public void setBeanName(String name) {
        this.beanName = name;
    }


    public void destroy(){
        System.out.println("调用destroy方法 "+beanName + " 正在销毁");
    }
}
